package com.aabte.design2.behavioral.mediator;

/**
 * @author Daniel
 * @version 1.0
 * @date 2020/5/4
 */
public class Application {

    public static void main(String[] args) {
        AuthenticationDialog authenticationDialog = new AuthenticationDialog();

        CheckBox loginOrRegister = new CheckBox(authenticationDialog);
        TextBox loginUsername = new TextBox(authenticationDialog);
        TextBox loginPassword = new TextBox(authenticationDialog);
        TextBox regUsername = new TextBox(authenticationDialog);
        TextBox regPassword = new TextBox(authenticationDialog);
        TextBox regEmail = new TextBox(authenticationDialog);
        Button okBtn = new Button(authenticationDialog);
        Button cancelBtn = new Button(authenticationDialog);
        CheckBox rememberMe = new CheckBox(authenticationDialog);

        loginOrRegister.setValue("tom");

        authenticationDialog.setLoginOrRegister(loginOrRegister);
        authenticationDialog.setLoginUsername(loginUsername);
        authenticationDialog.setLoginPassword(loginPassword);
        authenticationDialog.setRegUsername(regUsername);
        authenticationDialog.setRegPassword(regPassword);
        authenticationDialog.setRegEmail(regEmail);
        authenticationDialog.setOkBtn(okBtn);
        authenticationDialog.setCancelBtn(cancelBtn);
        authenticationDialog.setRememberMe(rememberMe);

        loginOrRegister.check();
        okBtn.click();
    }

}
